/*
  Name: 3.18 page100
  Copyright: 
  Author: Vincent
  Date: 15/07/09 11:14
  Description: 
*/
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int iarr[] = {1, 3, 5, 7, 9, 2, 4, 6, 8, 10};
    vector<int> ivec(iarr, iarr + 10);
    
    for (vector<int>::iterator itr = ivec.begin(); itr != ivec.end(); itr++)
    {
        cout << *itr << " ";
    }
    
    cout << endl;
                                                          
    for (vector<int>::iterator itr = ivec.begin(); itr != ivec.end(); itr++)
    {
        *itr = *itr * 2;
    }
    
    for (vector<int>::iterator itr = ivec.begin(); itr != ivec.end(); itr++)
    {
        cout << *itr << " ";
    }
    
    cout << endl;
    system("pause");
    return EXIT_SUCCESS;
    
}
